<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="/billing" prefix="b"%>
<%@page import="com.admin.service.ProvinceService"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>计费后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/wbox.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/wbox.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate.js"></script>
<script type="text/javascript">
<!--
	$(function(){
		$(".list div").mousemove(function(){
			$(this).css("background","#E3EEFF");
		}).mouseout(function(){
			$(this).css("background","");
		});
		$("#provinceId").val('${provinceId}');
		$("#isp").val('${isp}');
		$("#vodCustomized").val('${vodCustomized}');
	});

	function gobd(billingId){
		window.location.href="<%=request.getContextPath() %>/admin/billingSp/"+billingId;
	}

	function del(id){
		if(confirm("你确认解除该绑定吗?")){
			$.ajax({
				url:"<%=request.getContextPath()%>/admin/billingSp/del/"+id,
				type:"GET",
				success:function(flag){
					if(flag=='1'){
						alert("解除成功!");
						window.location.href="<%=request.getContextPath()%>/admin/billingSp/hasjoin/${billingId}";
					}else{
						alert("解除失败!");
					}
				}
			});
		}
	}
//-->
</script>
</head>
<body>
<div class="information">
	<c:choose>
		<c:when test="${not empty pageBean.result}">
			<div class="listTitle">
				<div class="noselect">
					<ul>
					<li style="width:40px;">编号</li>
					<li style="width:150px;">SP通道名</li>		
					<li style="width:60px;">端口</li>		
					<li style="width:60px;">指令</li>
					<li style="width:60px;">通道类型</li>
					<li style="width:60px;">资费</li>
					<li style="width:60px;">省份</li>
					<li style="width:60px;">运营商</li>
					<li style="width:200px;">操作</li>
				</ul>
				</div>
			</div>
			<div class="list" style="border-bottom:1px solid #ECECEC;">
				<c:forEach items="${pageBean.result}" var="spVo" varStatus="status">
					<div class="${status.index%2==0?'noselect':'select' }">
						<ul>
							<li style="width:40px;">${spVo.spBean.spId }</li>
							<li style="width:150px;">${spVo.spBean.spName }</li>	
							<li style="width:60px;">${spVo.spBean.port }</li>		
							<li style="width:60px;">${spVo.spBean.command }</li>
							<li style="width:60px;">
								<c:choose>
									<c:when test="${spVo.spBean.vodCustomized==0 }">点播</c:when>
									<c:when test="${spVo.spBean.vodCustomized==1 }">包月</c:when>
									<c:when test="${spVo.spBean.vodCustomized==2 }">定制</c:when>
								</c:choose>
							</li>
							<li style="width:60px;">${spVo.spBean.fee/10 }元</li>
							<li style="width:60px;"><b:province provinceId="${spVo.spBean.provinceId }"/></li>
							<li style="width:60px;">
								<c:choose>
									<c:when test="${spVo.spBean.isp==0 }">移动</c:when>
									<c:when test="${spVo.spBean.isp==1 }">联通</c:when>
									<c:when test="${spVo.spBean.isp==2 }">电信</c:when>
								</c:choose>
							</li>
							<li style="width:200px;">
								<span style="color: red;font-weight: bold;">${spVo.billingSpBean.count }条,总费用：${(spVo.spBean.fee*spVo.billingSpBean.count)/10 }元</span>|
								<a href="#" onclick="del('${spVo.billingSpBean.id}')">解除</a>
							</li>
						</ul>
					</div>
					<div class="clear"></div>
				</c:forEach>
			</div>
			<jsp:include page="../page.jsp" flush="true"></jsp:include>
			<div class="page">
				<input type="button" name="bd" value="继续绑定SP" onclick="gobd(${billingId});">
			</div>
		</c:when>
		<c:otherwise>
			<div style="text-align: center; border-bottom: 1px solid #ECECEC;color: red;font-size: 14px;font-weight: bold;">
				暂未绑定SP <input type="button" name="bd" value="进入绑定SP页面" onclick="gobd(${billingId})";>
			</div>
		</c:otherwise>
	</c:choose>
</div>
</body>
</html>